import {Application} from 'egg';

export default (app: Application) => {
    const mongoose = app.mongoose;
    const Schema = mongoose.Schema;
    const youngCardSchema = new Schema({
        avatar: {type: String},
        name: {type: String},
        userId: {type: String, required: true, unique: true},
        phone: {type: String},
        scope: {type: String},
        profession: {type: String},
        cardId: {type: String},
        status: {type: Number, default: 0}, // 0 未审核， 1 通过， -1 不通过
        applyDate: {type: Date},
        updateDate: {type: Date},
    });
    return mongoose.model('YoungCard', youngCardSchema);
}
